const fs = require('fs')
// 改造现有的异步API，让其能够返回promise对象，从而支持异步编程
const { promisify } = require('util')
let my_readFile = promisify(fs.readFile)

async function runAsync() {
    let asyncRes1 = await my_readFile('test1.txt', 'utf8')
    let asyncRes2 = await my_readFile('test2.txt', 'utf8')
    let asyncRes3 = await my_readFile('test3.txt', 'utf8')
    console.log(asyncRes1);
    console.log(asyncRes2);
    console.log(asyncRes3);
}
runAsync()
